feat(js-sdk): expose snapshot name parameter in createSnapshot#1250
Open
Crunchyman-ralph wants to merge 1 commit intoe2b-dev:mainfrom
Open
feat(js-sdk): expose snapshot name parameter in createSnapshot#1250Crunchyman-ralph wants to merge 1 commit intoe2b-dev:mainfrom
Crunchyman-ralph wants to merge 1 commit intoe2b-dev:mainfrom
Conversation
The REST API supports an optional `name` field when creating snapshots, allowing named snapshots that are addressable via Sandbox.create(). The SDK was sending an empty body, silently ignoring any name passed by the caller. Changes: - Add SnapshotCreateOpts interface extending SandboxApiOpts with optional `name` field - Forward the name in the POST request body - Expose `names` array from the API response in SnapshotInfo - Export SnapshotCreateOpts from package entry
|
This was referenced Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1249
The REST API supports an optional
namefield when creating snapshots, but the JS SDK was sending an empty body and not exposing the parameter. This PR:SnapshotCreateOptsinterface with optionalnamefieldnamesarray from the API response inSnapshotInfoSnapshotCreateOptsfrom the package entry pointChanges
packages/js-sdk/src/sandbox/sandboxApi.ts— NewSnapshotCreateOptstype, forwardnamein request body, returnnamesin responsepackages/js-sdk/src/sandbox/index.ts— Update instance method signature to useSnapshotCreateOptspackages/js-sdk/src/index.ts— ExportSnapshotCreateOptsUsage
Backwards compatible
SnapshotCreateOptsextendsSandboxApiOpts, so existing code usingSandboxApiOptsstill worksnameis optional — omitting it produces the same behavior as beforenamesis a new field onSnapshotInfo— existing code accessingsnapshotIdis unaffected